<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/plug/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/plug/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/plug/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/plug/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/plug/h-ui.admin/css/style.css" />
<title>详细流水</title>
<style type="text/css">
.total2{
	border-left: 0px solid gray;
	border-right: 2px solid gray;
}
.total3{
	border-left: 2px solid gray;
	border-right: 2px solid gray;
}
.total4{
	border-left: 2px solid gray;
}

</style>
</head>
<body>
	<div class="page-container">
		<div>
			日期范围： <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endTime\')||\'%y-%M-%d\'}',minDate:'2018-09-01',dateFmt:'yyyy-MM-dd HH:mm:ss' })" id="startTime"
				class="input-text Wdate" style="width: 180px;"> - <input type="text"
				onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'startTime\')||\'%y-%M-%d\'}',maxDate:'2018-09-01',dateFmt:'yyyy-MM-dd HH:mm:ss' })" id="endTime"
				class="input-text Wdate" style="width: 180px;"> 
			<button type="submit" class="btn btn-success radius" onclick="inList()">
				<i class="Hui-iconfont">&#xe665;</i> 查询
			</button>
		</div>
		
		<div class="mt-20">
			<div class="total-d total2" >
				<p>发放总额</p>
				<p class="tatols total-p" style="font-size: 35px;"></p>
				<p class="tatol-code"></p>
			</div>
			<div class="total-d total3">
				<p>有效使用</p>
				<p class="cash total-p" style="font-size: 35px;"></p>
				<p class="cash-code"></p>
			</div>
			<div class="total-d total4">
				<p></p>
				<p class="router total-p" style="font-size: 35px;"></p>
				<p class="router-code"></p>
			</div>
		</div>
	</div>
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="${ctx}/static/plug/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript" src="${ctx}/static/plug/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/plug/laypage/1.2/laypage.js"></script>
	<script type="text/javascript">
	
		function inList() {
			var param = getQueryParam();
			$.ajax({
				type : "POST",
				url : "${ctx}/coupon/allShopCoupon",
				data : param, //传入已封装的参数
				dataType : "json",
				success : function(result) {
					if(result){
						$(".tatols").html("￥"+(result.userCouponReleaseRespVo.totalMoney/10).toFixed(2));
						$(".tatol-code").html("共"+(result.userCouponReleaseRespVo.totalCount)+"张");
						
						$(".cash").html("￥"+(result.userCouponReleaseRespVo.usedMoney/10).toFixed(2));
						$(".cash-code").html("共"+(result.userCouponReleaseRespVo.usedCount)+"张");
					}else{
						$(".tatols").html("￥"+(0).toFixed(2));
						$(".tatol-code").html("共"+(0)+"张");
						
						$(".cash").html("￥"+(0).toFixed(2));
						$(".cash-code").html("共"+(0)+"张");
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					alert("查询失败");
				}
			});
		}
		$(function() {
			inList();
			$
		});
	

		function getQueryParam() {
			var param = {};
			var startTime = $("#startTime").val();
			var endTime = $("#endTime").val();
			if (startTime) {
				param.startTime = startTime ;
			}
			if (endTime) {
				param.endTime = endTime ;
			}
			//自定义的查询条件 后面加
			return param;
		}
	</script>
</body>
</html>
